import java.net.*;

/**
 * @author AMPM
 */

public class BobServer {

	public static void main(String args[]) throws Exception {
		// the server socket object is created
		int serverPort = 7897;
		ServerSocket serverSocket = new ServerSocket(serverPort);

		// when started, the server listens infinitely for new client
		// connections
		while (true) {
			// the server socket starts listening for connections. When a
			// connection
			// is requested from a client, a socket is returned
			Socket socket = serverSocket.accept();
			// the client is handled by the ClientHandler object in a separate
			// thread
			BobClientHandler handler = new BobClientHandler(socket);
			new Thread(handler).start();

		}
	}
}